import { FormArray, FormGroup } from '@angular/forms';
import { forEach } from 'lodash';

export const formSetValues = (form: FormGroup, obj: any) => {
  forEach(form.controls, (control, key) => {
    if (key in obj) {
      if (control instanceof FormArray) {
        // TODO
      } else {
        control.setValue(obj[key]);
      }
    }
  });
};
